﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Data.Objects;
using Model;

namespace Configuration.ModelConfiguration
{
    public class CategoryConfiguration : EntityConfiguration<Category>
    {
        public CategoryConfiguration()
        {
            Property(c => c.Id).IsIdentity();
            Property(c => c.Name).HasMaxLength(100).IsRequired();
            Relationship(c => c.Products).IsOptional().FromProperty(p => p.Category);
        }
    }
}
